home *** CD-ROM | disk | FTP | other *** search
- Path: news.bridge.net!news
- From: David Byrden <100101.2547@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Help: How to initialize objects created by new class[x]
- Date: 7 Jan 1996 23:09:27 GMT
- Organization: self-employed
- Message-ID: <4cpjr7$hlc@news.bridge.net>
- References: <4cicd6$lsv@news.capitalnet.com> <4cisdl$jt3@pipe9.nyc.pipeline.com>
- NNTP-Posting-Host: ppp-mia1-39.bridge.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
-
-
- Carey;
-
- >> I always call an initialization method after allocating arrays
- >> this way. The technique is called "2-phase construction".
-
- I don't know if _this_ is really what they call 2-phase construction.
- The objects in the example ARE constructed, in the array declaration,
- by the default constructor, i.e. they are in a valid state.
-
- Some classes have a valid 'null state' which the default ctor creates,
- and some do not.
-
- I believe that 2-phase construction is when a ctor puts the object in
- an invalid, unusable state, and you have to call a second function to
- finish constructing it. This was sometimes necessary before the era of
- exceptions.
-
- David
-
-
-